package com.bosssoft.trainee.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bosssoft.trainee.mbg.dto.DepartmentDTO;
import com.bosssoft.trainee.mbg.mapper.DepartmentMapper;
import com.bosssoft.trainee.mbg.po.Department;
import com.bosssoft.trainee.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: wuxin
 * @Project: rbac-SpringCloud
 * @Date: 2022/7/19
 * @Description:
 */
@Service
public class DepartmentServiceImp implements DepartmentService {
    @Autowired
    DepartmentMapper departmentMapper;
    /**
     * 获取全部的Department
     *
     * @return
     */
    @Override
    public List<Department> getList() {
        Department example = new Department();
        //这里加入一些查询条件
        QueryWrapper<Department> queryWrapper = new QueryWrapper<>(example);
        return departmentMapper.selectList(queryWrapper);
    }

    /**
     * 根据id删除Department
     *
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        return departmentMapper.deleteById(id);
    }
}
